import { Rule } from "./types";

export const PyflakesRuleList: Rule[] = [
    {
        code: "F401",
        name: "unused-import",
        descEn: "{name} imported but unused; consider using importlib.util.find_spec to test for availability",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F402",
        name: "import-shadowed-by-loop-var",
        descEn: "Import {name} from line {line} shadowed by loop variable",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F403",
        name: "undefined-local-with-import-star",
        descEn: "from {name} import * used; unable to detect undefined names",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F404",
        name: "late-future-import",
        descEn: "from __future__ imports must occur at the beginning of the file",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F405",
        name: "undefined-local-with-import-star-usage",
        descEn: "{name} may be undefined, or defined from star imports:",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F406",
        name: "undefined-local-with-nested-import-star-usage",
        descEn: "from {name} import * only allowed at module level",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F407",
        name: "future-feature-not-defined",
        descEn: "Future feature {name} is not defined",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F501",
        name: "percent-format-invalid-format",
        descEn: "%-format string has invalid format string:",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F502",
        name: "percent-format-expected-mapping",
        descEn: "%-format string expected mapping but got sequence",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F503",
        name: "percent-format-expected-sequence",
        descEn: "%-format string expected sequence but got mapping",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F504",
        name: "percent-format-extra-named-arguments",
        descEn: "%-format string has unused named argument(s):",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F505",
        name: "percent-format-missing-argument",
        descEn: "%-format string is missing argument(s) for placeholder(s):	",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F506",
        name: "percent-format-mixed-positional-and-named",
        descEn: "%-format string has mixed positional and named placeholders",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F507",
        name: "percent-format-positional-count-mismatch",
        descEn: "%-format string has {wanted} placeholder(s) but {got} substitution(s)",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F508",
        name: "percent-format-star-requires-sequence",
        descEn: "%-format string * specifier requires sequence",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F509",
        name: "percent-format-unsupported-format-character",
        descEn: "%-format string has unsupported format character {char}",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F521",
        name: "string-dot-format-invalid-format",
        descEn: ".format call has invalid format string:",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F522",
        name: "string-dot-format-extra-named-arguments",
        descEn: ".format call has unused named argument(s):",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F523",
        name: "string-dot-format-extra-positional-arguments",
        descEn: ".format call has unused arguments at position(s):",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F524",
        name: "string-dot-format-missing-arguments",
        descEn: ".format call is missing argument(s) for placeholder(s):",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F525",
        name: "string-dot-format-mixing-automatic",
        descEn: ".format string mixes automatic and manual numbering",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F541",
        name: "f-string-missing-placeholders",
        descEn: "f-string without any placeholders",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F601",
        name: "multi-value-repeated-key-literal",
        descEn: "Dictionary key literal {name} repeated",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F602",
        name: "multi-value-repeated-key-variable",
        descEn: "Dictionary key {name} repeated",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F621",
        name: "expressions-in-star-assignment",
        descEn: "Too many expressions in star-unpacking assignment",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F622",
        name: "multiple-starred-expressions",
        descEn: "Two starred expressions in assignment",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F631",
        name: "assert-tuple",
        descEn: "Assert test is a non-empty tuple, which is always True",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F632",
        name: "is-literal",
        descEn: "Use == to compare constant literals",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F633",
        name: "invalid-print-syntax",
        descEn: "Use of >> is invalid with print function",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F634",
        name: "if-tuple",
        descEn: "If test is a tuple, which is always True",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F701",
        name: "break-outside-loop",
        descEn: "break outside loop",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F702",
        name: "continue-outside-loop",
        descEn: "continue not properly in loop",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F704",
        name: "yield-outside-function",
        descEn: "{keyword} statement outside of a function	",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F706",
        name: "return-outside-function",
        descEn: "return statement outside of a function/method",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F707",
        name: "default-except-not-last",
        descEn: "An except block as not the last exception handler",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F722",
        name: "forward-annotation-syntax-error",
        descEn: "Syntax error in forward annotation: {body}	",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F811",
        name: "redefined-while-unused",
        descEn: "Redefinition of unused {name} from line",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F821",
        name: "undefined-name",
        descEn: "Undefined name {name}",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F822",
        name: "undefined-export",
        descEn: "Undefined name {name} in __all__",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F823",
        name: "undefined-local",
        descEn: "Local variable {name} referenced before assignment",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F841",
        name: "unused-variable",
        descEn: "Local variable {name} is assigned to but never used",
        descCn: "",
        autoFix: true,
    },
    {
        code: "F842",
        name: "unused-annotation",
        descEn: "Local variable {name} is annotated but never used",
        descCn: "",
        autoFix: false,
    },
    {
        code: "F901",
        name: "raise-not-implemented",
        descEn: "raise NotImplemented should be raise NotImplementedError",
        descCn: "",
        autoFix: true,
    },
];